/**
* <p>Title: User</p>
* <p>Description: CS343 Project</p>
* @author Derek Meisner
* @author Conor Lauer
* @author Derek Thompson
* @email meis0056@umn.edu
* @email conor.lauer@my.uwrf.edu
* @email derek.thompson-1@my.uwrf.edu
* @date 11/14/2012
* @team Derek, Conor, Derek
*/

package golfScore;

public class User {

	private String userName;
	private float average;
	private int userInstance;
	private int totalHolesPlayed;
	private int totalScore;
	
	/**
	   * constructor
	   * @require average <> 0
	   * @ensure
	   */
	public User(String userName, float average, int instance){
		this.userName =  userName;
		this.setAverage(average);
		this.userInstance = instance;
	}
	
	/**
	   * getName
	   * @require
	   * @ensure
	   */
	public String getName(){ 
		return userName; 
	}

	public int getUserInstance() {
		return userInstance;
	}

	/**
	   * getAverage
	   * @require
	   * @ensure
	   */
	public float getAverage(){
		return average;
	}

	/**
	   * setAverage
	   * @require
	   * @ensure
	   */
	public void setAverage(float average){
		this.average = average;
	}
	
	/**
	   * calculateAverage
	   * @require totalHolesPlayed > 0
	   * @ensure
	   */
	public void calculateAverage(float totalHoles, float totalScores){
		//total score / total holes played.
		//make sure total holes played is not 0.
		float average;
		average = totalScores / totalHoles;
		this.setAverage(average);
		System.out.println(this.getAverage());
	}

	/**
	   * getTotalHolesPlayed
	   * @require
	   * @ensure
	   */
	public int getTotalHolesPlayed() {
		return totalHolesPlayed;
	}

	/**
	   * setTotalHolesPlayed
	   * @require totalHolesPlayed > 0
	   * @ensure
	   */
	public void setTotalHolesPlayed(int totalHolesPlayed) {
		this.totalHolesPlayed = totalHolesPlayed;
	}

	/**
	   * getTotalScore
	   * @require
	   * @ensure
	   */
	public int getTotalScore() {
		return totalScore;
	}

	/**
	   * setTotalScore
	   * @require setTotalScore > 0
	   * @ensure
	   */
	public void setTotalScore(int totalScore) {
		this.totalScore = totalScore;
	}
}
